var json = [{
		"name": "护理组织管理",
		"desc": "2020/12/08 10:15",
		"phone": "12334444",
		"type": "1"
	},
	{
		"name": "护理人员管理22",
		"desc": "2020/12/08 10:15",
		"phone": "123377777",
		"type": "1"
	},
	{
		"name": "护理人员分层级培训...",
		"desc": "2020/12/08 10:15",
		"phone": "12336666",
		"type": "2"
	},
	{
		"name": "护理人员聘用管理办法sssss",
		"desc": "2020/12/08 10:15",
		"phone": "12336666",
		"type": "2"
	}
]

function NurRulesFileList() {
	this.initPlus()
	this.initData()
	this.initEvent()
}

NurRulesFileList.prototype.initPlus = function() {
	$initPlus(function(web) {
		$setText(".mui-title", web.title)
		$log(web.title)
		//返回携带参数
		$backWindow('HBuilder', {
			name: "测试"
		})
	})
}

NurRulesFileList.prototype.initData = function() {
	function gotoDetail(e) {
		$fastClick(function() {
			var item = json[e.index]
			var title = item.name
			var url = item.type == 2 ? "data-url2" : "data-url"
			$openWindow(e, url, {
				title:title
			})

		})
	}
	$listDataShowClick(json, "item-grid", "gird", function() {
		gotoDetail(this)
	})
	$listDataShowClick(json, "item-list", "list", function() {
		gotoDetail(this)
	})
}

NurRulesFileList.prototype.initEvent = function() {
	$toggle("#filelist", "#filegrid");
	$toggle("#gird", "#list");
	$click('filegrid', function() {
		$toggle("#filelist", "#filegrid")
		$toggle("#gird", "#list")
	})
	$click('filelist', function() {
		$toggle("#filegrid", "#filelist")
		$toggle("#list", "#gird")

	})

}

new NurRulesFileList()
